# -*- coding: utf-8 -*-
"""
Created on Tue Apr 19 09:26:30 2022

@author: Xiao
"""

# HWES
from statsmodels.tsa.holtwinters import SimpleExpSmoothing, ExponentialSmoothing
from random import random
# contrived dataset
data = [10,5,7,5,6,6,4,5,4]
# fit model
model = ExponentialSmoothing(data, seasonal=None)
model_fit = model.fit()
# make prediction
yhat = model_fit.predict(len(data), len(data))
print(yhat)

data = [19,12,13,8,7,9,7,7,10]
# fit model
model = ExponentialSmoothing(data, seasonal=None)
model_fit = model.fit()
# make prediction
yhat = model_fit.predict(len(data), len(data))
print(yhat)

data = [21,24,12,12,8,9,11,8,13]
# fit model
model = SimpleExpSmoothing(data)
model_fit = model.fit()
# make prediction
yhat = model_fit.predict(len(data), len(data))
print(yhat)

data = [6,21,8,7,5,5,6,10,10]
# fit model
model = SimpleExpSmoothing(data)
model_fit = model.fit()
# make prediction
yhat = model_fit.predict(len(data), len(data))
print(yhat)
